<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>三栏布局--float</title>
	</head>
	<style>
		* {
			margin: 0;
			padding: 0;
			box-sizing: border-box;
		}

		.left {
			float: left;
			width: 300px;
			height: 100px;
			background: teal;
		}

		.right {
			float: right;
			width: 300px;
			height: 100px;
			background: sandybrown;
		}

		.center {
			height: 200px;
			margin-left: 300px;
			margin-right: 300px;
			background-color: tan;
		}

		.main {
			height: 100vh;
			min-width: 1020px;
			overflow-x: auto;
		}
	</style>

	<body>
		<!-- 左侧和右侧元素需要在center前面 -->
		<div class="main">
			<div class="left">左-float</div>
			<div class="right">右-float</div>
			<div class="center">中-margin</div>
		</div>
	</body>
</html>
